home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Trading on the Edge
/
Trading On The Edge - CD-ROM Toolkit (Wayzata Technology)(2031)(1994).bin
/
pc
/
mac_file
/
vendor_d
/
neuralwa
/
nw2v50
/
easyprob.ipb
< prev
next >
Wrap
Text File
|
1993-08-23
|
9KB
|
405 lines
inst4.0 ! Oct 29 1990
!****************************************************************
!* *
!* Easy Probe Script *
!* *
!****************************************************************
!
!Preliminaries
!
=PNam "Output" !Start off with default probe
!
@LLsl !Load super layer
?EPEp 0 !Epoch requested
>beq Aux1Set !No
?Lax1 0 !Has Aux 1 (Epoch) been set up?
>bgt Aux1Set !Yes
=Lax1 16 !Set a default value
@SVsl
:Aux1Set
!Calculate output layer number (n5) and #PEs in output (n4)
@LLsl !Load super layer
=n5 Lpes !number of layers
-n5 1 !output layer number
=LayN n5 !Look at output layer
@LLly !Load it
=n4 Lpes !# PEs in output layer
!Use n7 to flag a potentially bipolar output
=n7 0 !Unipolar by default
?Ltrn "Sigmoid" !Sigmoid?
>beq UniPolar !Yes
?Ltrn "Perceptron" !Perceptron?
>beq UniPolar !Yes
?Ltrn "StepFunction" !Step function?
>beq UniPolar !Yes
?Lcmp "Direct" !Direct
>bne UniPolar !No
! Direct, non-sigmoid are potentially BiPolar
=n7 1 !Bipolar
:UniPolar
!Calculate #PEs in network (n6)
=n6 n4 !# PEs in network (Except input and bias)
=LayN n5 !Output layer
:CountPEs
-LayN 1 !Next layer Down
?LayN 0 !At Input layer?
>ble PEsCnted !Yes
@LLly !Load next layer
+n6 Lpes !increment number of PEs
>br CountPEs
:PEsCnted
!
! Now check if we need to prompt for probes
?EPPb 2 !Layer Probe?
>beq PromptPb !Yes
?EPPb 4 !PE Probe?
>beq PromptPb !Yes
>br NoPrompt !Don't Prompt
:PromptPb
@Vars NP !Prompt for near layer and position
@NrLX !Get layer index of PE
?NPEl 0
>bge BldProbe
@Err "Invalid PE (Bias) selected for instrument"
!
:BldProbe ! Need to construct a probe
?EPPb 4 ! PE Probe?
>beq PEProbe
=PNam "_lay_"
+PNam NPEl !Append layer number to name
@PbAS !Add Probe
@PbDC !Delete all components
@PALy !Add Near Layer to Probe
! Now save #PEs in layer for future reference
=LayN NPEl !Pointed to layer
@LLly !Load it
=n4 Lpes !# PEs in Probe
=n3 n4
/n3 LDnr !Divide by #rows in display
>br BldInstr
!
:PEProbe
=PNam "_pe_" !prefix
+PNam NPEn !Index in layer
@PbAS !Add Probe
?PbSt 0 !Check status of probe
>bne PEPbOK !OK, not there yet
=n0 n6 !Look for Unique probe
=n1 n0
+n1 100 !Give up after 100
:PEPb1
+n0 1
?n0 n1
>beq PEPb2
=PNam "_pe_" !prefix
+PNam n0 !Arbitrary suffix
@PbAS !Add Probe
?PbSt 0 !Check status of probe
>beq PEPb1 !Already there, try again
:PEPbOK
@PAPE !Add Near PE to probe
=n4 1 !# PEs in Probe
=n3 1 !#x
>br BldInstr
:PEPb2
@Err "Probe table full; cannot create confusion matrix"
:NoPrompt
@Vars P !Prompt position only
?EPPb 0 !Network Probe?
>bne NotNetWk
=n4 n6 !# PEs in Probe
=n3 n6 !#x
>br BldInstr
:NotNetWk
?EPPb 1 !Output Probe?
>bne NotOutLy
=LayN n5 !Output layer
@LLly !Load it
=n4 Lpes !# PEs in Probe
=n3 n4
/n3 LDnr !Divide by #rows in display
! If it is the output layer and the graph is a histogram,
! we must build a probe consisting of just the output
! layer. The default probe which consists of all layers
! except the input layer will not do because a histogram
! instrument will read all the values off the probe. Note:
! Only do this for Histograms, otherwise NeuralWorks
! Explorer will not be able to do other output instruments
?EPGr 3 !Histogram?
>bne BldInstr !No
=PNam "_out_lay" !Probe name
=NPEl n5 !Output Layer
@NrPE !Point to it
@PbAS !Add Probe
@PbDC !Delete all components
@PALy !Add Near Layer to Probe
>br BldInstr
:NotOutLy
! Must be input layer
=LayN 0
@LLly !Load it
=n4 Lpes !# PEs in Probe
=n3 n4
/n3 LDnr !Divide by #rows in display
! Add input layer probe
=PNam "_in_lay" !Probe name
=NPEl 0 !Input Layer
@NrPE !Point to it
@PbAS !Add Probe
@PbDC !Delete all components
@PALy !Add Near Layer to Probe
!
:BldInstr
@ILdD !load default instrument
!
! *** Calculate # plots and #x ***
!
! Defaults:
!
=Inpl n4 !Default: Total # PEs in Probe
=Ignx n3 !Default: As defined above
=ICAc 0 !No convergence criterion
=ICTh 0.0 !Zero convergence threshold
!
! RMS over layer is an exception to #plots:
!
?EPVr 1 !RMS error over layer?
>bne NumPl1 !No
>br NumPl3
?EPVr 6 !RMS Weights over layer?
>bne NumPl1 !No
:NumPl3
?EPPb 0 !Network Probe?
>bne NumPl2 !No
=Inpl n5
-Inpl 1 !#layers - 1
=Ignx Inpl
>br NumPl1
:NumPl2
=Inpl 1
=Ignx 1
:NumPl1
!
! *** Graph Type dependent stuff ***
!
! *** STRIP CHARTS ***
!
! #x for Strip charts is an exception:
?EPGr 0 !Strip chart?
>bne NotStrip !No
=Ignx 100 !Nominal # plot points
=Ihgt 64 !Nominal Height
=Iwdt 300 !Nominal Width
?EPEp 0 !Epoch Option?
>bne Strip1 !Yes
=ILDv 10 !Nominal Learn Divisor
:Strip1
! Set up convergence criterion if RMS Error strip
?EPVr 1 !RMS Error over layer?
>bne EndGType !No
?EPPb 1 !Output layer?
>bne EndGType !No
! Don't activate criterion because of Radial Basis Function Nets
! Just set up threshold
!=ICAc 1 !Activate convergence criterion
=ICTh 0.001 !Low convergence threshold
>br EndGType
!
! *** HISTOGRAMS ***
!
! #plots for Histograms is an exception:
:NotStrip
?EPGr 3 !Histogram?
>bne NotHisto !No
=Ignx 30 !Nominal # Bins
=Ihgt 64 !Nominal Height
=Iwdt 300 !Nominal Width
=ILDv 5 !Nominal Learn Divisor
?EPEp 0 !Epoch Option?
>bne Histo1 !Yes
=ILDv 20 !Nominal Learn Divisor
:Histo1
>br EndGType
!
!
! *** CONFUSION MATRICES ***
!
! #plots and #x for Confusion matrices are exceptions
:NotHisto
?EPGr 4 !Confusion Matrix?
>bne NotConfM !No
=Ignx 9
=Inpl 81
=Ihgt 90 !Nominal Height
=Iwdt 90 !Nominal Width
=ILDv 5 !Every 5 Epochs
! Epoch is forced for Confusion matrix
=EPEp 1 !Force epoch
>br EndGType
!
!
!
! *** CLASSIFICATION RATE MATRICES ***
!
! #plots and #x for Classification rate matrices are exceptions
:NotConfM
?EPGr 6 !Classification rate?
>bne NotClsRt !No
=Ignx Inpl !#PEs
?Ignx 2 !At least two?
>bge ClsRt1
=Ignx 2 !Make it two
:ClsRt1
=Inpl Ignx
*Inpl Ignx !squared
=Ihgt Ignx
*Ihgt 35 !Nominal Height
=Iwdt Ignx
*Iwdt 65 !Nominal Width
=ILDv 5 !Every 5 Epochs
! Epoch is forced for Classification Rate matrix
=EPEp 1 !Force epoch
>br EndGType
!
!
! *** BAR, MATRIX, HINTON ***
!
:NotClsRt
! Try to set a good height and width
=Iwdt Ignx
=Ihgt Inpl
/Ihgt Ignx
*Iwdt 10
*Ihgt 10
=n0 64
?Iwdt n0
>bgt Bar1
=Iwdt n0
:Bar1
?Ihgt n0
>bgt EndGType
=Ihgt n0
!
:EndGType
!
! *** Other Default stuff ***
!
=IEpc EPEp !Set epoch flag
=ILnA 1 !Active in Learn
=IRcA 0 !NOT Active in recall
=IGTy EPGr !Graph Type
=IGVr "CurErr" !Variable
=ITTy "RMS" !RMS Transformation Type
=ITMd 0 !No Transformation
=IPrb PNam !Point to probe
! Use n2 to flag -ve vmin; this is a fairly complicated
! function of variable type, graph type and epoch option,
! so it is difficult to come up with a good default, and
! there are several exceptions below
=n2 1 !Negative vmin
! Most epoch graphs should have non-negative vmin
! (exceptions: Histogram, Confusion Matrix, Classification Rate)
! vmin for Non-epoch graphs needs to be determined based
! on variable type.
?EPEp 0 !Epoch Option?
>beq VMin1 !No
?EPGr 3 !Histogram?
>beq VMin1 !Yes
?EPGr 4 !Confusion Matrix?
>beq VMin1 !Yes
?EPGr 6 !Classification Rate?
>beq VMin1 !Yes
=n2 0 !Non-Negative vmin
:VMin1
!
! *** Variable dependent stuff ***
!
! *** PE ERROR ***
!
?EPVr 0 !PE Error?
>bne NotPEErr !No
=ITit "PE Error" !Instrument title
=Ivmx 1.0 !Maximum plotted value
>br NotRMSLy
!
! *** RMS ERROR ***
!
:NotPEErr
?EPVr 1 !RMS Error over layer?
>bne NotRMSEr !No
=ITit "RMS Error" !Instrument title
=ITMd 2 !Transform over component
=n2 0 !Always non-negative vmin
=Ivmx 1.0
>br NotRMSLy
!
! *** OUTPUT VALUE ***
!
:NotRMSEr
?EPVr 2 !Output Value?
>bne NotOutpV !No
=ITit "Output Value" !Instrument title
=IGVr "Out" !Plot Output
=Ivmx 1.0 !Maximum plotted value
=IRcA 1 !ACTIVE in recall
?n2 0 !potentially negative vmin?
>beq OutpV1 !No
?n7 0 !BiPolar Output?
>bne OutpV1 !Yes
=n2 0 !Non-negative vmin
:OutpV1
>br NotRMSLy
!
! *** SUMMATION VALUE ***
!
:NotOutpV
?EPVr 3 !Summation Value?
>bne NotSumV !No
=ITit "Summation Value" !Instrument title
=IGVr "Sum" !Plot Summation
=Ivmx 3.0 !Maximum plotted value
=IRcA 1 !ACTIVE in recall
>br NotRMSLy
!
! *** INDIVIDUAL WEIGHT VALUE ***
!
:NotSumV
! Must be some sort of weight value. Set up default
! vmax and variable to be plotted
=Ivmx 8.0
=IGVr "Weight" !Plot Weight Value
!
?EPVr 4 !Individual Weight Value?
>bne NotIndWt !No
=ITit "Individual Weights" !Instrument title
>br NotRMSLy
!
! *** RMS WEIGHT VALUE OVER PE ***
!
:NotIndWt
?EPVr 5 !RMS Weight Value over PE?
>bne NotRMSPE !No
=ITit "RMS Weights (PE)" !Instrument title
=n2 0 !Always non-negative vmin
=ITMd 1 !Transform over node
>br NotRMSLy
!
! *** RMS WEIGHT VALUE OVER LAYER ***
!
:NotRMSPE
=EPVr 6 !FORCE RMS Weight Value over PE?
=ITit "RMS Weights (Layer)" !Instrument title
=n2 0 !Always non-negative vmin
=ITMd 2 !Transform over component
!
:NotRMSLy
!
=Ivmn 0.0 !Minimum plotted value
?n2 0 !Signed vmin?
>beq AddInstr !No
-Ivmn Ivmx !Negative of vmax
!
:AddInstr !Finally...
@IAdd !... add instrument